package com.lzh.seatrend.entity;


import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Min;
import javax.validation.constraints.Size;
import java.util.List;


/**
 * Parameter
 *
 * @author lzh
 */
public class Parameter {

    @NotEmpty(message = "姓名不能为空")
    private String name;

    @Min(value = 18, message = "年龄必须大于18岁")
    private int age;

    @NotEmpty(message = "hobbies不能为空")
    private List<String> hobbies;

    @NotBlank(message = "账号不能为空")
    private String account;

    @Size(min = 5, max = 10, message = "密码的长度应该在5和10之间")
    private String password;

    @Email(message = "邮箱格式错误")
    private String email;

//    private List<org.springframework.validation.FieldError> fieldErrors;

    public Parameter() {
    }

    public Parameter(@NotEmpty(message = "姓名不能为空") String name, @Min(value = 18, message = "年龄必须大于18岁") int age, @NotEmpty(message = "hobbies不能为空") List<String> hobbies, @NotBlank(message = "账号不能为空") String account, @Size(min = 5, max = 10, message = "密码的长度应该在5和10之间") String password, @Email(message = "邮箱格式错误") String email) {
        this.name = name;
        this.age = age;
        this.hobbies = hobbies;
        this.account = account;
        this.password = password;
        this.email = email;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public List<String> getHobbies() {
        return hobbies;
    }

    public void setHobbies(List<String> hobbies) {
        this.hobbies = hobbies;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }


}